// 引入mongoose模块
const mongoose = require("mongoose")

// 创建约束对象
const adminSchema = new mongoose.Schema({
    adminName: {
        type: String,
        required: true,
        unique: true,
    },
    password: {
        type: String,
        required: true,
    },
    regTime: {
        type: String,
        required: true
    },
    logTime: {
        type: String,
        required: true,
        default: "..."
    },
    status: {
        type: Number,
        require: true,
        default: 0
    }
})

//根据上面的约束对象，创建数据集合
const adminModel = mongoose.model("adminList", adminSchema)

// 数据集合暴露
module.exports = adminModel